<!--#include file="top.asp"-->

<%
	dim rs_rpt_mandarin, str_rpt_mandarin
	set rs_rpt_mandarin = server.CreateObject("ADODB.Recordset")
	str_rpt_mandarin = "select * from rpt_mandarin where stu_id = '" & request.QueryString("stu_id") & "'"
	rs_rpt_mandarin.open str_rpt_mandarin, conn,1,3	
	
	if rs_rpt_mandarin.eof then
		'response.Write "hey, nothing here"
		rs_rpt_mandarin.addnew
		rs_rpt_mandarin.fields("stu_id") = request.QueryString("stu_id")
		rs_rpt_mandarin.update
		rs_rpt_mandarin.close
		rs_rpt_mandarin.open str_rpt_mandarin, conn, 1, 3
	end if

	for i = 1 to rs_rpt_mandarin.fields.count - 1
		rs_rpt_mandarin.fields(i) = request.Form("rs_rpt_mandarin_" & i)
	next
	rs_rpt_mandarin.update
%>

</body>
</html>
<%
	rs_rpt_mandarin.close
	set rpt_mandarin = nothing
	call closeconn()
	response.Redirect("./rpt_mandarin.asp?stu_id=" & request.QueryString("stu_id"))
%>